package com.wuchao.servlet143;

import javax.persistence.criteria.CriteriaBuilder;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * @author 吴超66
 * @version 1.0
 * @date 2022/4/24 14:42
 */
@WebServlet(name = "PageController",urlPatterns = "/PageController")
public class PageController extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setCharacterEncoding("utf-8");
        response.setContentType("text/html;charset=utf-8");
        PrintWriter out=response.getWriter();//文件流
        int currentPage= Integer.parseInt(request.getParameter("currentPage"));
        int pageSize= Integer.parseInt(request.getParameter("pageSize"));
        request.getRequestDispatcher("demo71/page.jsp?currentPage="+
                currentPage+"&pageSize="+pageSize)
                .forward(request,response);

        out.flush();
        out.close();
    }
}
